package com.xiaoxin.controller;

import com.xiaoxin.common.core.domain.R;
import com.xiaoxin.domain.RequestBean;
import com.xiaoxin.domain.ResponseBean;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author: ZhangXX
 * @createTime: 2024-08-24 08:19
 **/
@Tag(name = "TestRestTemplateController")
@RestController
@RequestMapping()
public class TestRestTemplateController {

    /**
     * 模拟JSON请求，post方法测试
     *
     * @return
     * @paramrequest
     */
    @Operation(summary = "测试testPostByJsonObj", description = "testPostByJsonObj")
    @RequestMapping(value = "testPostByJsonObj", method = RequestMethod.POST)
    public R<ResponseBean> testPostByJsonObj(@RequestBody RequestBean requestBean, HttpServletRequest request) {
        //范型测试
        ResponseBean responseBean = new ResponseBean();
        responseBean.setCode("200000");
        responseBean.setMsg("responseBean");
        //范型测试
        return R.ok("请求成功", responseBean);
    }

}
